package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * URL路径映射 → value属性
 * @author stone
 * @date 2022/12/22 17:15
 */
@Controller
public class UrlMappingController {

    //localhost:8080/hello
    //localhost:8080/hi
    //localhost:8080/nihao
    //@RequestMapping(value = {"hello","hi","nihao"})
    @RequestMapping({"hello","hi","nihao"})
    @ResponseBody
    public String hello() {
        return "hello demo5";
    }
    //localhost:8080/goodbye
    //localhost:8080/goodbyesong
    //localhost:8080/goodbyeligenli
    //localhost:8080/goodbye/ligenli
    //localhost:8080/goodbye/xuejia
    // 可以使用通配符*
    @RequestMapping({"goodbye*","goodbye/*"})
    @ResponseBody
    public String goodbye() {
        return "byebye";
    }
}
